home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / lispref.info-20 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  46.4 KB  |  1,177 lines

  1. This is Info file ../../info/lispref.info, produced by Makeinfo-1.63
  2. from the input file lispref.texi.
  3.  
  4.    Edition History:
  5.  
  6.    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
  7. Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
  8. Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
  9. XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
  10. GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
  11. Programmer's Manual (for 19.13) Third Edition, July 1995
  12.  
  13.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
  14. Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
  15. Copyright (C) 1995 Amdahl Corporation.  Copyright (C) 1995 Ben Wing.
  16.  
  17.    Permission is granted to make and distribute verbatim copies of this
  18. manual provided the copyright notice and this permission notice are
  19. preserved on all copies.
  20.  
  21.    Permission is granted to copy and distribute modified versions of
  22. this manual under the conditions for verbatim copying, provided that the
  23. entire resulting derived work is distributed under the terms of a
  24. permission notice identical to this one.
  25.  
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that this permission notice may be stated in a
  29. translation approved by the Foundation.
  30.  
  31.    Permission is granted to copy and distribute modified versions of
  32. this manual under the conditions for verbatim copying, provided also
  33. that the section entitled "GNU General Public License" is included
  34. exactly as in the original, and provided that the entire resulting
  35. derived work is distributed under the terms of a permission notice
  36. identical to this one.
  37.  
  38.    Permission is granted to copy and distribute translations of this
  39. manual into another language, under the above conditions for modified
  40. versions, except that the section entitled "GNU General Public License"
  41. may be included in a translation approved by the Free Software
  42. Foundation instead of in the original English.
  43.  
  44. 
  45. File: lispref.info,  Node: Writing to Files,  Next: File Locks,  Prev: Reading from Files,  Up: Files
  46.  
  47. Writing to Files
  48. ================
  49.  
  50.    You can write the contents of a buffer, or part of a buffer, directly
  51. to a file on disk using the `append-to-file' and `write-region'
  52. functions.  Don't use these functions to write to files that are being
  53. visited; that could cause confusion in the mechanisms for visiting.
  54.  
  55.  - Command: append-to-file START END FILENAME
  56.      This function appends the contents of the region delimited by
  57.      START and END in the current buffer to the end of file FILENAME.
  58.      If that file does not exist, it is created.  This function returns
  59.      `nil'.
  60.  
  61.      An error is signaled if FILENAME specifies a nonwritable file, or
  62.      a nonexistent file in a directory where files cannot be created.
  63.  
  64.  - Command: write-region START END FILENAME &optional APPEND VISIT
  65.      This function writes the region delimited by START and END in the
  66.      current buffer into the file specified by FILENAME.
  67.  
  68.      If START is a string, then `write-region' writes or appends that
  69.      string, rather than text from the buffer.
  70.  
  71.      If APPEND is non-`nil', then the specified text is appended to the
  72.      existing file contents (if any).
  73.  
  74.      If VISIT is `t', then XEmacs establishes an association between
  75.      the buffer and the file: the buffer is then visiting that file.
  76.      It also sets the last file modification time for the current
  77.      buffer to FILENAME's modtime, and marks the buffer as not
  78.      modified.  This feature is used by `save-buffer', but you probably
  79.      should not use it yourself.
  80.  
  81.      If VISIT is a string, it specifies the file name to visit.  This
  82.      way, you can write the data to one file (FILENAME) while recording
  83.      the buffer as visiting another file (VISIT).  The argument VISIT
  84.      is used in the echo area message and also for file locking; VISIT
  85.      is stored in `buffer-file-name'.  This feature is used to
  86.      implement `file-precious-flag'; don't use it yourself unless you
  87.      really know what you're doing.
  88.  
  89.      The function `write-region' converts the data which it writes to
  90.      the appropriate file formats specified by `buffer-file-format'.
  91.      *Note Format Conversion::.  It also calls the functions in the list
  92.      `write-region-annotate-functions'; see *Note Saving Properties::.
  93.  
  94.      Normally, `write-region' displays a message `Wrote file FILENAME'
  95.      in the echo area.  If VISIT is neither `t' nor `nil' nor a string,
  96.      then this message is inhibited.  This feature is useful for
  97.      programs that use files for internal purposes, files that the user
  98.      does not need to know about.
  99.  
  100. 
  101. File: lispref.info,  Node: File Locks,  Next: Information about Files,  Prev: Writing to Files,  Up: Files
  102.  
  103. File Locks
  104. ==========
  105.  
  106.    When two users edit the same file at the same time, they are likely
  107. to interfere with each other.  XEmacs tries to prevent this situation
  108. from arising by recording a "file lock" when a file is being modified.
  109. XEmacs can then detect the first attempt to modify a buffer visiting a
  110. file that is locked by another XEmacs job, and ask the user what to do.
  111.  
  112.    File locks do not work properly when multiple machines can share
  113. file systems, such as with NFS.  Perhaps a better file locking system
  114. will be implemented in the future.  When file locks do not work, it is
  115. possible for two users to make changes simultaneously, but XEmacs can
  116. still warn the user who saves second.  Also, the detection of
  117. modification of a buffer visiting a file changed on disk catches some
  118. cases of simultaneous editing; see *Note Modification Time::.
  119.  
  120.  - Function: file-locked-p &optional FILENAME
  121.      This function returns `nil' if the file FILENAME is not locked by
  122.      this XEmacs process.  It returns `t' if it is locked by this
  123.      XEmacs, and it returns the name of the user who has locked it if it
  124.      is locked by someone else.
  125.  
  126.           (file-locked-p "foo")
  127.                => nil
  128.  
  129.  - Function: lock-buffer &optional FILENAME
  130.      This function locks the file FILENAME, if the current buffer is
  131.      modified.  The argument FILENAME defaults to the current buffer's
  132.      visited file.  Nothing is done if the current buffer is not
  133.      visiting a file, or is not modified.
  134.  
  135.  - Function: unlock-buffer
  136.      This function unlocks the file being visited in the current buffer,
  137.      if the buffer is modified.  If the buffer is not modified, then
  138.      the file should not be locked, so this function does nothing.  It
  139.      also does nothing if the current buffer is not visiting a file.
  140.  
  141.  - Function: ask-user-about-lock FILE OTHER-USER
  142.      This function is called when the user tries to modify FILE, but it
  143.      is locked by another user named OTHER-USER.  The value it returns
  144.      determines what happens next:
  145.  
  146.         * A value of `t' says to grab the lock on the file.  Then this
  147.           user may edit the file and OTHER-USER loses the lock.
  148.  
  149.         * A value of `nil' says to ignore the lock and let this user
  150.           edit the file anyway.
  151.  
  152.         * This function may instead signal a `file-locked' error, in
  153.           which case the change that the user was about to make does
  154.           not take place.
  155.  
  156.           The error message for this error looks like this:
  157.  
  158.                error--> File is locked: FILE OTHER-USER
  159.  
  160.           where `file' is the name of the file and OTHER-USER is the
  161.           name of the user who has locked the file.
  162.  
  163.      The default definition of this function asks the user to choose
  164.      what to do.  If you wish, you can replace the `ask-user-about-lock'
  165.      function with your own version that decides in another way.  The
  166.      code for its usual definition is in `userlock.el'.
  167.  
  168. 
  169. File: lispref.info,  Node: Information about Files,  Next: Changing File Attributes,  Prev: File Locks,  Up: Files
  170.  
  171. Information about Files
  172. =======================
  173.  
  174.    The functions described in this section all operate on strings that
  175. designate file names.  All the functions have names that begin with the
  176. word `file'.  These functions all return information about actual files
  177. or directories, so their arguments must all exist as actual files or
  178. directories unless otherwise noted.
  179.  
  180. * Menu:
  181.  
  182. * Testing Accessibility::   Is a given file readable?  Writable?
  183. * Kinds of Files::          Is it a directory?  A symbolic link?
  184. * Truenames::            Eliminating symbolic links from a file name.
  185. * File Attributes::         How large is it?  Any other names?  Etc.
  186.  
  187. 
  188. File: lispref.info,  Node: Testing Accessibility,  Next: Kinds of Files,  Up: Information about Files
  189.  
  190. Testing Accessibility
  191. ---------------------
  192.  
  193.    These functions test for permission to access a file in specific
  194. ways.
  195.  
  196.  - Function: file-exists-p FILENAME
  197.      This function returns `t' if a file named FILENAME appears to
  198.      exist.  This does not mean you can necessarily read the file, only
  199.      that you can find out its attributes.  (On Unix, this is true if
  200.      the file exists and you have execute permission on the containing
  201.      directories, regardless of the protection of the file itself.)
  202.  
  203.      If the file does not exist, or if fascist access control policies
  204.      prevent you from finding the attributes of the file, this function
  205.      returns `nil'.
  206.  
  207.  - Function: file-readable-p FILENAME
  208.      This function returns `t' if a file named FILENAME exists and you
  209.      can read it.  It returns `nil' otherwise.
  210.  
  211.           (file-readable-p "files.texi")
  212.                => t
  213.           (file-exists-p "/usr/spool/mqueue")
  214.                => t
  215.           (file-readable-p "/usr/spool/mqueue")
  216.                => nil
  217.  
  218.  - Function: file-executable-p FILENAME
  219.      This function returns `t' if a file named FILENAME exists and you
  220.      can execute it.  It returns `nil' otherwise.  If the file is a
  221.      directory, execute permission means you can check the existence and
  222.      attributes of files inside the directory, and open those files if
  223.      their modes permit.
  224.  
  225.  - Function: file-writable-p FILENAME
  226.      This function returns `t' if the file FILENAME can be written or
  227.      created by you, and `nil' otherwise.  A file is writable if the
  228.      file exists and you can write it.  It is creatable if it does not
  229.      exist, but the specified directory does exist and you can write in
  230.      that directory.
  231.  
  232.      In the third example below, `foo' is not writable because the
  233.      parent directory does not exist, even though the user could create
  234.      such a directory.
  235.  
  236.           (file-writable-p "~/foo")
  237.                => t
  238.           (file-writable-p "/foo")
  239.                => nil
  240.           (file-writable-p "~/no-such-dir/foo")
  241.                => nil
  242.  
  243.  - Function: file-accessible-directory-p DIRNAME
  244.      This function returns `t' if you have permission to open existing
  245.      files in the directory whose name as a file is DIRNAME; otherwise
  246.      (or if there is no such directory), it returns `nil'.  The value
  247.      of DIRNAME may be either a directory name or the file name of a
  248.      directory.
  249.  
  250.      Example: after the following,
  251.  
  252.           (file-accessible-directory-p "/foo")
  253.                => nil
  254.  
  255.      we can deduce that any attempt to read a file in `/foo/' will give
  256.      an error.
  257.  
  258.  - Function: file-ownership-preserved-p FILENAME
  259.      This function returns `t' if deleting the file FILENAME and then
  260.      creating it anew would keep the file's owner unchanged.
  261.  
  262.  - Function: file-newer-than-file-p FILENAME1 FILENAME2
  263.      This function returns `t' if the file FILENAME1 is newer than file
  264.      FILENAME2.  If FILENAME1 does not exist, it returns `nil'.  If
  265.      FILENAME2 does not exist, it returns `t'.
  266.  
  267.      In the following example, assume that the file `aug-19' was written
  268.      on the 19th, `aug-20' was written on the 20th, and the file
  269.      `no-file' doesn't exist at all.
  270.  
  271.           (file-newer-than-file-p "aug-19" "aug-20")
  272.                => nil
  273.           (file-newer-than-file-p "aug-20" "aug-19")
  274.                => t
  275.           (file-newer-than-file-p "aug-19" "no-file")
  276.                => t
  277.           (file-newer-than-file-p "no-file" "aug-19")
  278.                => nil
  279.  
  280.      You can use `file-attributes' to get a file's last modification
  281.      time as a list of two numbers.  *Note File Attributes::.
  282.  
  283. 
  284. File: lispref.info,  Node: Kinds of Files,  Next: Truenames,  Prev: Testing Accessibility,  Up: Information about Files
  285.  
  286. Distinguishing Kinds of Files
  287. -----------------------------
  288.  
  289.    This section describes how to distinguish various kinds of files,
  290. such as directories, symbolic links, and ordinary files.
  291.  
  292.  - Function: file-symlink-p FILENAME
  293.      If the file FILENAME is a symbolic link, the `file-symlink-p'
  294.      function returns the file name to which it is linked.  This may be
  295.      the name of a text file, a directory, or even another symbolic
  296.      link, or it may be a nonexistent file name.
  297.  
  298.      If the file FILENAME is not a symbolic link (or there is no such
  299.      file), `file-symlink-p' returns `nil'.
  300.  
  301.           (file-symlink-p "foo")
  302.                => nil
  303.           (file-symlink-p "sym-link")
  304.                => "foo"
  305.           (file-symlink-p "sym-link2")
  306.                => "sym-link"
  307.           (file-symlink-p "/bin")
  308.                => "/pub/bin"
  309.  
  310.  
  311.  - Function: file-directory-p FILENAME
  312.      This function returns `t' if FILENAME is the name of an existing
  313.      directory, `nil' otherwise.
  314.  
  315.           (file-directory-p "~rms")
  316.                => t
  317.           (file-directory-p "~rms/lewis/files.texi")
  318.                => nil
  319.           (file-directory-p "~rms/lewis/no-such-file")
  320.                => nil
  321.           (file-directory-p "$HOME")
  322.                => nil
  323.           (file-directory-p
  324.            (substitute-in-file-name "$HOME"))
  325.                => t
  326.  
  327.  - Function: file-regular-p FILENAME
  328.      This function returns `t' if the file FILENAME exists and is a
  329.      regular file (not a directory, symbolic link, named pipe,
  330.      terminal, or other I/O device).
  331.  
  332. 
  333. File: lispref.info,  Node: Truenames,  Next: File Attributes,  Prev: Kinds of Files,  Up: Information about Files
  334.  
  335. Truenames
  336. ---------
  337.  
  338.    The "truename" of a file is the name that you get by following
  339. symbolic links until none remain, then expanding to get rid of `.' and
  340. `..' as components.  Strictly speaking, a file need not have a unique
  341. truename; the number of distinct truenames a file has is equal to the
  342. number of hard links to the file.  However, truenames are useful
  343. because they eliminate symbolic links as a cause of name variation.
  344.  
  345.  - Function: file-truename FILENAME &optional DEFAULT
  346.      The function `file-truename' returns the true name of the file
  347.      FILENAME.  This is the name that you get by following symbolic
  348.      links until none remain.
  349.  
  350.      If the filename is relative, DEFAULT is the directory to start
  351.      with.  If DEFAULT is `nil' or missing, the current buffer's value
  352.      of `default-directory' is used.
  353.  
  354.    *Note Buffer File Name::, for related information.
  355.  
  356. 
  357. File: lispref.info,  Node: File Attributes,  Prev: Truenames,  Up: Information about Files
  358.  
  359. Other Information about Files
  360. -----------------------------
  361.  
  362.    This section describes the functions for getting detailed information
  363. about a file, other than its contents.  This information includes the
  364. mode bits that control access permission, the owner and group numbers,
  365. the number of names, the inode number, the size, and the times of access
  366. and modification.
  367.  
  368.  - Function: file-modes FILENAME
  369.      This function returns the mode bits of FILENAME, as an integer.
  370.      The mode bits are also called the file permissions, and they
  371.      specify access control in the usual Unix fashion.  If the
  372.      low-order bit is 1, then the file is executable by all users, if
  373.      the second-lowest-order bit is 1, then the file is writable by all
  374.      users, etc.
  375.  
  376.      The highest value returnable is 4095 (7777 octal), meaning that
  377.      everyone has read, write, and execute permission, that the SUID bit
  378.      is set for both others and group, and that the sticky bit is set.
  379.  
  380.           (file-modes "~/junk/diffs")
  381.                => 492               ; Decimal integer.
  382.           (format "%o" 492)
  383.                => "754"             ; Convert to octal.
  384.           
  385.           (set-file-modes "~/junk/diffs" 438)
  386.                => nil
  387.           
  388.           (format "%o" 438)
  389.                => "666"             ; Convert to octal.
  390.           
  391.           % ls -l diffs
  392.             -rw-rw-rw-  1 lewis 0 3063 Oct 30 16:00 diffs
  393.  
  394.  - Function: file-nlinks FILENAME
  395.      This functions returns the number of names (i.e., hard links) that
  396.      file FILENAME has.  If the file does not exist, then this function
  397.      returns `nil'.  Note that symbolic links have no effect on this
  398.      function, because they are not considered to be names of the files
  399.      they link to.
  400.  
  401.           % ls -l foo*
  402.           -rw-rw-rw-  2 rms       4 Aug 19 01:27 foo
  403.           -rw-rw-rw-  2 rms       4 Aug 19 01:27 foo1
  404.           
  405.           (file-nlinks "foo")
  406.                => 2
  407.           (file-nlinks "doesnt-exist")
  408.                => nil
  409.  
  410.  - Function: file-attributes FILENAME
  411.      This function returns a list of attributes of file FILENAME.  If
  412.      the specified file cannot be opened, it returns `nil'.
  413.  
  414.      The elements of the list, in order, are:
  415.  
  416.        0. `t' for a directory, a string for a symbolic link (the name
  417.           linked to), or `nil' for a text file.
  418.  
  419.        1. The number of names the file has.  Alternate names, also
  420.           known as hard links, can be created by using the
  421.           `add-name-to-file' function (*note Changing File
  422.           Attributes::.).
  423.  
  424.        2. The file's UID.
  425.  
  426.        3. The file's GID.
  427.  
  428.        4. The time of last access, as a list of two integers.  The
  429.           first integer has the high-order 16 bits of time, the second
  430.           has the low 16 bits.  (This is similar to the value of
  431.           `current-time'; see *Note Time of Day::.)
  432.  
  433.        5. The time of last modification as a list of two integers (as
  434.           above).
  435.  
  436.        6. The time of last status change as a list of two integers (as
  437.           above).
  438.  
  439.        7. The size of the file in bytes.
  440.  
  441.        8. The file's modes, as a string of ten letters or dashes, as in
  442.           `ls -l'.
  443.  
  444.        9. `t' if the file's GID would change if file were deleted and
  445.           recreated; `nil' otherwise.
  446.  
  447.       10. The file's inode number.
  448.  
  449.       11. The file system number of the file system that the file is
  450.           in.  This element and the file's inode number together give
  451.           enough information to distinguish any two files on the
  452.           system--no two files can have the same values for both of
  453.           these numbers.
  454.  
  455.      For example, here are the file attributes for `files.texi':
  456.  
  457.           (file-attributes "files.texi")
  458.                =>  (nil
  459.                     1
  460.                     2235
  461.                     75
  462.                     (8489 20284)
  463.                     (8489 20284)
  464.                     (8489 20285)
  465.                     14906
  466.                     "-rw-rw-rw-"
  467.                     nil
  468.                     129500
  469.                     -32252)
  470.  
  471.      and here is how the result is interpreted:
  472.  
  473.     `nil'
  474.           is neither a directory nor a symbolic link.
  475.  
  476.     `1'
  477.           has only one name (the name `files.texi' in the current
  478.           default directory).
  479.  
  480.     `2235'
  481.           is owned by the user with UID 2235.
  482.  
  483.     `75'
  484.           is in the group with GID 75.
  485.  
  486.     `(8489 20284)'
  487.           was last accessed on Aug 19 00:09.  Unfortunately, you cannot
  488.           convert this number into a time string in XEmacs.
  489.  
  490.     `(8489 20284)'
  491.           was last modified on Aug 19 00:09.
  492.  
  493.     `(8489 20285)'
  494.           last had its inode changed on Aug 19 00:09.
  495.  
  496.     `14906'
  497.           is 14906 characters long.
  498.  
  499.     `"-rw-rw-rw-"'
  500.           has a mode of read and write access for the owner, group, and
  501.           world.
  502.  
  503.     `nil'
  504.           would retain the same GID if it were recreated.
  505.  
  506.     `129500'
  507.           has an inode number of 129500.
  508.  
  509.     `-32252'
  510.           is on file system number -32252.
  511.  
  512. 
  513. File: lispref.info,  Node: Changing File Attributes,  Next: File Names,  Prev: Information about Files,  Up: Files
  514.  
  515. Changing File Names and Attributes
  516. ==================================
  517.  
  518.    The functions in this section rename, copy, delete, link, and set the
  519. modes of files.
  520.  
  521.    In the functions that have an argument NEWNAME, if a file by the
  522. name of NEWNAME already exists, the actions taken depend on the value
  523. of the argument OK-IF-ALREADY-EXISTS:
  524.  
  525.    * Signal a `file-already-exists' error if OK-IF-ALREADY-EXISTS is
  526.      `nil'.
  527.  
  528.    * Request confirmation if OK-IF-ALREADY-EXISTS is a number.
  529.  
  530.    * Replace the old file without confirmation if OK-IF-ALREADY-EXISTS
  531.      is any other value.
  532.  
  533.  - Command: add-name-to-file OLDNAME NEWNAME &optional
  534.           OK-IF-ALREADY-EXISTS
  535.      This function gives the file named OLDNAME the additional name
  536.      NEWNAME.  This means that NEWNAME becomes a new "hard link" to
  537.      OLDNAME.
  538.  
  539.      In the first part of the following example, we list two files,
  540.      `foo' and `foo3'.
  541.  
  542.           % ls -l fo*
  543.           -rw-rw-rw-  1 rms       29 Aug 18 20:32 foo
  544.           -rw-rw-rw-  1 rms       24 Aug 18 20:31 foo3
  545.  
  546.      Then we evaluate the form `(add-name-to-file "~/lewis/foo"
  547.      "~/lewis/foo2")'.  Again we list the files.  This shows two names,
  548.      `foo' and `foo2'.
  549.  
  550.           (add-name-to-file "~/lewis/foo1" "~/lewis/foo2")
  551.                => nil
  552.           
  553.           % ls -l fo*
  554.           -rw-rw-rw-  2 rms       29 Aug 18 20:32 foo
  555.           -rw-rw-rw-  2 rms       29 Aug 18 20:32 foo2
  556.           -rw-rw-rw-  1 rms       24 Aug 18 20:31 foo3
  557.  
  558.      Finally, we evaluate the following:
  559.  
  560.           (add-name-to-file "~/lewis/foo" "~/lewis/foo3" t)
  561.  
  562.      and list the files again.  Now there are three names for one file:
  563.      `foo', `foo2', and `foo3'.  The old contents of `foo3' are lost.
  564.  
  565.           (add-name-to-file "~/lewis/foo1" "~/lewis/foo3")
  566.                => nil
  567.           
  568.           % ls -l fo*
  569.           -rw-rw-rw-  3 rms       29 Aug 18 20:32 foo
  570.           -rw-rw-rw-  3 rms       29 Aug 18 20:32 foo2
  571.           -rw-rw-rw-  3 rms       29 Aug 18 20:32 foo3
  572.  
  573.      This function is meaningless on VMS, where multiple names for one
  574.      file are not allowed.
  575.  
  576.      See also `file-nlinks' in *Note File Attributes::.
  577.  
  578.  - Command: rename-file FILENAME NEWNAME &optional OK-IF-ALREADY-EXISTS
  579.      This command renames the file FILENAME as NEWNAME.
  580.  
  581.      If FILENAME has additional names aside from FILENAME, it continues
  582.      to have those names.  In fact, adding the name NEWNAME with
  583.      `add-name-to-file' and then deleting FILENAME has the same effect
  584.      as renaming, aside from momentary intermediate states.
  585.  
  586.      In an interactive call, this function prompts for FILENAME and
  587.      NEWNAME in the minibuffer; also, it requests confirmation if
  588.      NEWNAME already exists.
  589.  
  590.  - Command: copy-file OLDNAME NEWNAME &optional OK-IF-EXISTS TIME
  591.      This command copies the file OLDNAME to NEWNAME.  An error is
  592.      signaled if OLDNAME does not exist.
  593.  
  594.      If TIME is non-`nil', then this functions gives the new file the
  595.      same last-modified time that the old one has.  (This works on only
  596.      some operating systems.)
  597.  
  598.      In an interactive call, this function prompts for FILENAME and
  599.      NEWNAME in the minibuffer; also, it requests confirmation if
  600.      NEWNAME already exists.
  601.  
  602.  - Command: delete-file FILENAME
  603.      This command deletes the file FILENAME, like the shell command `rm
  604.      FILENAME'.  If the file has multiple names, it continues to exist
  605.      under the other names.
  606.  
  607.      A suitable kind of `file-error' error is signaled if the file does
  608.      not exist, or is not deletable.  (On Unix, a file is deletable if
  609.      its directory is writable.)
  610.  
  611.      See also `delete-directory' in *Note Create/Delete Dirs::.
  612.  
  613.  - Command: make-symbolic-link FILENAME NEWNAME &optional OK-IF-EXISTS
  614.      This command makes a symbolic link to FILENAME, named NEWNAME.
  615.      This is like the shell command `ln -s FILENAME NEWNAME'.
  616.  
  617.      In an interactive call, this function prompts for FILENAME and
  618.      NEWNAME in the minibuffer; also, it requests confirmation if
  619.      NEWNAME already exists.
  620.  
  621.  - Function: define-logical-name VARNAME STRING
  622.      This function defines the logical name NAME to have the value
  623.      STRING.  It is available only on VMS.
  624.  
  625.  - Function: set-file-modes FILENAME MODE
  626.      This function sets mode bits of FILENAME to MODE (which must be an
  627.      integer).  Only the low 12 bits of MODE are used.
  628.  
  629.  - Function: set-default-file-modes MODE
  630.      This function sets the default file protection for new files
  631.      created by XEmacs and its subprocesses.  Every file created with
  632.      XEmacs initially has this protection.  On Unix, the default
  633.      protection is the bitwise complement of the "umask" value.
  634.  
  635.      The argument MODE must be an integer.  Only the low 9 bits of MODE
  636.      are used.
  637.  
  638.      Saving a modified version of an existing file does not count as
  639.      creating the file; it does not change the file's mode, and does
  640.      not use the default file protection.
  641.  
  642.  - Function: default-file-modes
  643.      This function returns the current default protection value.
  644.  
  645.    On MS-DOS, there is no such thing as an "executable" file mode bit.
  646. So Emacs considers a file executable if its name ends in `.com', `.bat'
  647. or `.exe'.  This is reflected in the values returned by `file-modes'
  648. and `file-attributes'.
  649.  
  650. 
  651. File: lispref.info,  Node: File Names,  Next: Contents of Directories,  Prev: Changing File Attributes,  Up: Files
  652.  
  653. File Names
  654. ==========
  655.  
  656.    Files are generally referred to by their names, in XEmacs as
  657. elsewhere.  File names in XEmacs are represented as strings.  The
  658. functions that operate on a file all expect a file name argument.
  659.  
  660.    In addition to operating on files themselves, Emacs Lisp programs
  661. often need to operate on the names; i.e., to take them apart and to use
  662. part of a name to construct related file names.  This section describes
  663. how to manipulate file names.
  664.  
  665.    The functions in this section do not actually access files, so they
  666. can operate on file names that do not refer to an existing file or
  667. directory.
  668.  
  669.    On VMS, all these functions understand both VMS file-name syntax and
  670. Unix syntax.  This is so that all the standard Lisp libraries can
  671. specify file names in Unix syntax and work properly on VMS without
  672. change.  On MS-DOS, these functions understand MS-DOS file-name syntax
  673. as well as Unix syntax.
  674.  
  675. * Menu:
  676.  
  677. * File Name Components::  The directory part of a file name, and the rest.
  678. * Directory Names::       A directory's name as a directory
  679.                             is different from its name as a file.
  680. * Relative File Names::   Some file names are relative to a current directory.
  681. * File Name Expansion::   Converting relative file names to absolute ones.
  682. * Unique File Names::     Generating names for temporary files.
  683. * File Name Completion::  Finding the completions for a given file name.
  684.  
  685. 
  686. File: lispref.info,  Node: File Name Components,  Next: Directory Names,  Up: File Names
  687.  
  688. File Name Components
  689. --------------------
  690.  
  691.    The operating system groups files into directories.  To specify a
  692. file, you must specify the directory and the file's name within that
  693. directory.  Therefore, XEmacs considers a file name as having two main
  694. parts: the "directory name" part, and the "nondirectory" part (or "file
  695. name within the directory").  Either part may be empty.  Concatenating
  696. these two parts reproduces the original file name.
  697.  
  698.    On Unix, the directory part is everything up to and including the
  699. last slash; the nondirectory part is the rest.  The rules in VMS syntax
  700. are complicated.
  701.  
  702.    For some purposes, the nondirectory part is further subdivided into
  703. the name proper and the "version number".  On Unix, only backup files
  704. have version numbers in their names; on VMS, every file has a version
  705. number, but most of the time the file name actually used in XEmacs
  706. omits the version number.  Version numbers are found mostly in
  707. directory lists.
  708.  
  709.  - Function: file-name-directory FILENAME
  710.      This function returns the directory part of FILENAME (or `nil' if
  711.      FILENAME does not include a directory part).  On Unix, the
  712.      function returns a string ending in a slash.  On VMS, it returns a
  713.      string ending in one of the three characters `:', `]', or `>'.
  714.  
  715.           (file-name-directory "lewis/foo")  ; Unix example
  716.                => "lewis/"
  717.           (file-name-directory "foo")        ; Unix example
  718.                => nil
  719.           (file-name-directory "[X]FOO.TMP") ; VMS example
  720.                => "[X]"
  721.  
  722.  - Function: file-name-nondirectory FILENAME
  723.      This function returns the nondirectory part of FILENAME.
  724.  
  725.           (file-name-nondirectory "lewis/foo")
  726.                => "foo"
  727.           (file-name-nondirectory "foo")
  728.                => "foo"
  729.           ;; The following example is accurate only on VMS.
  730.           (file-name-nondirectory "[X]FOO.TMP")
  731.                => "FOO.TMP"
  732.  
  733.  - Function: file-name-sans-versions FILENAME &optional
  734.           KEEP-BACKUP-VERSION
  735.      This function returns FILENAME without any file version numbers,
  736.      backup version numbers, or trailing tildes.
  737.  
  738.      If KEEP-BACKUP-VERSION is non-`nil', we do not remove backup
  739.      version numbers, only true file version numbers.
  740.  
  741.           (file-name-sans-versions "~rms/foo.~1~")
  742.                => "~rms/foo"
  743.           (file-name-sans-versions "~rms/foo~")
  744.                => "~rms/foo"
  745.           (file-name-sans-versions "~rms/foo")
  746.                => "~rms/foo"
  747.           ;; The following example applies to VMS only.
  748.           (file-name-sans-versions "foo;23")
  749.                => "foo"
  750.  
  751.  - Function: file-name-sans-extension FILENAME
  752.      This function returns FILENAME minus its "extension," if any.  The
  753.      extension, in a file name, is the part that starts with the last
  754.      `.' in the last name component.  For example,
  755.  
  756.           (file-name-sans-extension "foo.lose.c")
  757.                => "foo.lose"
  758.           (file-name-sans-extension "big.hack/foo")
  759.                => "big.hack/foo"
  760.  
  761. 
  762. File: lispref.info,  Node: Directory Names,  Next: Relative File Names,  Prev: File Name Components,  Up: File Names
  763.  
  764. Directory Names
  765. ---------------
  766.  
  767.    A "directory name" is the name of a directory.  A directory is a
  768. kind of file, and it has a file name, which is related to the directory
  769. name but not identical to it.  (This is not quite the same as the usual
  770. Unix terminology.)  These two different names for the same entity are
  771. related by a syntactic transformation.  On Unix, this is simple: a
  772. directory name ends in a slash, whereas the directory's name as a file
  773. lacks that slash.  On VMS, the relationship is more complicated.
  774.  
  775.    The difference between a directory name and its name as a file is
  776. subtle but crucial.  When an XEmacs variable or function argument is
  777. described as being a directory name, a file name of a directory is not
  778. acceptable.
  779.  
  780.    The following two functions convert between directory names and file
  781. names.  They do nothing special with environment variable substitutions
  782. such as `$HOME', and the constructs `~', and `..'.
  783.  
  784.  - Function: file-name-as-directory FILENAME
  785.      This function returns a string representing FILENAME in a form
  786.      that the operating system will interpret as the name of a
  787.      directory.  In Unix, this means appending a slash to the string.
  788.      On VMS, the function converts a string of the form `[X]Y.DIR.1' to
  789.      the form `[X.Y]'.
  790.  
  791.           (file-name-as-directory "~rms/lewis")
  792.                => "~rms/lewis/"
  793.  
  794.  - Function: directory-file-name DIRNAME
  795.      This function returns a string representing DIRNAME in a form that
  796.      the operating system will interpret as the name of a file.  On
  797.      Unix, this means removing a final slash from the string.  On VMS,
  798.      the function converts a string of the form `[X.Y]' to `[X]Y.DIR.1'.
  799.  
  800.           (directory-file-name "~lewis/")
  801.                => "~lewis"
  802.  
  803.    Directory name abbreviations are useful for directories that are
  804. normally accessed through symbolic links.  Sometimes the users recognize
  805. primarily the link's name as "the name" of the directory, and find it
  806. annoying to see the directory's "real" name.  If you define the link
  807. name as an abbreviation for the "real" name, XEmacs shows users the
  808. abbreviation instead.
  809.  
  810.    If you wish to convert a directory name to its abbreviation, use this
  811. function:
  812.  
  813.  - Function: abbreviate-file-name DIRNAME &optional HACK-HOMEDIR
  814.      This function applies abbreviations from `directory-abbrev-alist'
  815.      to its argument, and substitutes `~' for the user's home directory.
  816.  
  817.      If HACK-HOMEDIR is non-`nil', then this also substitutes `~' for
  818.      the user's home directory.
  819.  
  820.  
  821.  - Variable: directory-abbrev-alist
  822.      The variable `directory-abbrev-alist' contains an alist of
  823.      abbreviations to use for file directories.  Each element has the
  824.      form `(FROM . TO)', and says to replace FROM with TO when it
  825.      appears in a directory name.  The FROM string is actually a
  826.      regular expression; it should always start with `^'.  The function
  827.      `abbreviate-file-name' performs these substitutions.
  828.  
  829.      You can set this variable in `site-init.el' to describe the
  830.      abbreviations appropriate for your site.
  831.  
  832.      Here's an example, from a system on which file system `/home/fsf'
  833.      and so on are normally accessed through symbolic links named `/fsf'
  834.      and so on.
  835.  
  836.           (("^/home/fsf" . "/fsf")
  837.            ("^/home/gp" . "/gp")
  838.            ("^/home/gd" . "/gd"))
  839.  
  840.    To convert a directory name to its abbreviation, use this function:
  841.  
  842.  - Function: abbreviate-file-name DIRNAME
  843.      This function applies abbreviations from `directory-abbrev-alist'
  844.      to its argument, and substitutes `~' for the user's home directory.
  845.  
  846. 
  847. File: lispref.info,  Node: Relative File Names,  Next: File Name Expansion,  Prev: Directory Names,  Up: File Names
  848.  
  849. Absolute and Relative File Names
  850. --------------------------------
  851.  
  852.    All the directories in the file system form a tree starting at the
  853. root directory.  A file name can specify all the directory names
  854. starting from the root of the tree; then it is called an "absolute"
  855. file name.  Or it can specify the position of the file in the tree
  856. relative to a default directory; then it is called a "relative" file
  857. name.  On Unix, an absolute file name starts with a slash or a tilde
  858. (`~'), and a relative one does not.  The rules on VMS are complicated.
  859.  
  860.  - Function: file-name-absolute-p FILENAME
  861.      This function returns `t' if file FILENAME is an absolute file
  862.      name, `nil' otherwise.  On VMS, this function understands both
  863.      Unix syntax and VMS syntax.
  864.  
  865.           (file-name-absolute-p "~rms/foo")
  866.                => t
  867.           (file-name-absolute-p "rms/foo")
  868.                => nil
  869.           (file-name-absolute-p "/user/rms/foo")
  870.                => t
  871.  
  872. 
  873. File: lispref.info,  Node: File Name Expansion,  Next: Unique File Names,  Prev: Relative File Names,  Up: File Names
  874.  
  875. Functions that Expand Filenames
  876. -------------------------------
  877.  
  878.    "Expansion" of a file name means converting a relative file name to
  879. an absolute one.  Since this is done relative to a default directory,
  880. you must specify the default directory name as well as the file name to
  881. be expanded.  Expansion also simplifies file names by eliminating
  882. redundancies such as `./' and `NAME/../'.
  883.  
  884.  - Function: expand-file-name FILENAME &optional DIRECTORY
  885.      This function converts FILENAME to an absolute file name.  If
  886.      DIRECTORY is supplied, it is the directory to start with if
  887.      FILENAME is relative.  (The value of DIRECTORY should itself be an
  888.      absolute directory name; it may start with `~'.) Otherwise, the
  889.      current buffer's value of `default-directory' is used.  For
  890.      example:
  891.  
  892.           (expand-file-name "foo")
  893.                => "/xcssun/users/rms/lewis/foo"
  894.           (expand-file-name "../foo")
  895.                => "/xcssun/users/rms/foo"
  896.           (expand-file-name "foo" "/usr/spool/")
  897.                => "/usr/spool/foo"
  898.           (expand-file-name "$HOME/foo")
  899.                => "/xcssun/users/rms/lewis/$HOME/foo"
  900.  
  901.      Filenames containing `.' or `..' are simplified to their canonical
  902.      form:
  903.  
  904.           (expand-file-name "bar/../foo")
  905.                => "/xcssun/users/rms/lewis/foo"
  906.  
  907.      `~/' is expanded into the user's home directory.  A `/' or `~'
  908.      following a `/' is taken to be the start of an absolute file name
  909.      that overrides what precedes it, so everything before that `/' or
  910.      `~' is deleted.  For example:
  911.  
  912.           (expand-file-name
  913.            "/a1/gnu//usr/local/lib/emacs/etc/MACHINES")
  914.                => "/usr/local/lib/emacs/etc/MACHINES"
  915.           (expand-file-name "/a1/gnu/~/foo")
  916.                => "/xcssun/users/rms/foo"
  917.  
  918.      In both cases, `/a1/gnu/' is discarded because an absolute file
  919.      name follows it.
  920.  
  921.      Note that `expand-file-name' does *not* expand environment
  922.      variables; only `substitute-in-file-name' does that.
  923.  
  924.  - Function: file-relative-name FILENAME &optional DIRECTORY
  925.      This function does the inverse of expansion--it tries to return a
  926.      relative name that is equivalent to FILENAME when interpreted
  927.      relative to DIRECTORY.  (If such a relative name would be longer
  928.      than the absolute name, it returns the absolute name instead.)
  929.  
  930.      If DIRECTORY is `nil' or omitted, the value of `default-directory'
  931.      is used.
  932.  
  933.           (file-relative-name "/foo/bar" "/foo/")
  934.                => "bar")
  935.           (file-relative-name "/foo/bar" "/hack/")
  936.                => "/foo/bar")
  937.  
  938.  - Variable: default-directory
  939.      The value of this buffer-local variable is the default directory
  940.      for the current buffer.  It should be an absolute directory name;
  941.      it may start with `~'.  This variable is local in every buffer.
  942.  
  943.      `expand-file-name' uses the default directory when its second
  944.      argument is `nil'.
  945.  
  946.      On Unix systems, the value is always a string ending with a slash.
  947.  
  948.           default-directory
  949.                => "/user/lewis/manual/"
  950.  
  951.  - Function: substitute-in-file-name FILENAME
  952.      This function replaces environment variables references in
  953.      FILENAME with the environment variable values.  Following standard
  954.      Unix shell syntax, `$' is the prefix to substitute an environment
  955.      variable value.
  956.  
  957.      The environment variable name is the series of alphanumeric
  958.      characters (including underscores) that follow the `$'.  If the
  959.      character following the `$' is a `{', then the variable name is
  960.      everything up to the matching `}'.
  961.  
  962.      Here we assume that the environment variable `HOME', which holds
  963.      the user's home directory name, has value `/xcssun/users/rms'.
  964.  
  965.           (substitute-in-file-name "$HOME/foo")
  966.                => "/xcssun/users/rms/foo"
  967.  
  968.      If a `~' or a `/' appears following a `/', after substitution,
  969.      everything before the following `/' is discarded:
  970.  
  971.           (substitute-in-file-name "bar/~/foo")
  972.                => "~/foo"
  973.           (substitute-in-file-name "/usr/local/$HOME/foo")
  974.                => "/xcssun/users/rms/foo"
  975.  
  976.      On VMS, `$' substitution is not done, so this function does nothing
  977.      on VMS except discard superfluous initial components as shown
  978.      above.
  979.  
  980. 
  981. File: lispref.info,  Node: Unique File Names,  Next: File Name Completion,  Prev: File Name Expansion,  Up: File Names
  982.  
  983. Generating Unique File Names
  984. ----------------------------
  985.  
  986.    Some programs need to write temporary files.  Here is the usual way
  987. to construct a name for such a file:
  988.  
  989.      (make-temp-name (concat "/tmp/" NAME-OF-APPLICATION))
  990.  
  991. Here we use the directory `/tmp/' because that is the standard place on
  992. Unix for temporary files.  The job of `make-temp-name' is to prevent
  993. two different users or two different jobs from trying to use the same
  994. name.
  995.  
  996.  - Function: make-temp-name STRING
  997.      This function generates string that can be used as a unique name.
  998.      The name starts with STRING, and ends with a number that is
  999.      different in each XEmacs job.
  1000.  
  1001.           (make-temp-name "/tmp/foo")
  1002.                => "/tmp/foo021304"
  1003.  
  1004.      To prevent conflicts among different libraries running in the same
  1005.      XEmacs, each Lisp program that uses `make-temp-name' should have
  1006.      its own STRING.  The number added to the end of the name
  1007.      distinguishes between the same application running in different
  1008.      XEmacs jobs.
  1009.  
  1010. 
  1011. File: lispref.info,  Node: File Name Completion,  Prev: Unique File Names,  Up: File Names
  1012.  
  1013. File Name Completion
  1014. --------------------
  1015.  
  1016.    This section describes low-level subroutines for completing a file
  1017. name.  For other completion functions, see *Note Completion::.
  1018.  
  1019.  - Function: file-name-all-completions PARTIAL-FILENAME DIRECTORY
  1020.      This function returns a list of all possible completions for a file
  1021.      whose name starts with PARTIAL-FILENAME in directory DIRECTORY.
  1022.      The order of the completions is the order of the files in the
  1023.      directory, which is unpredictable and conveys no useful
  1024.      information.
  1025.  
  1026.      The argument PARTIAL-FILENAME must be a file name containing no
  1027.      directory part and no slash.  The current buffer's default
  1028.      directory is prepended to DIRECTORY, if DIRECTORY is not absolute.
  1029.  
  1030.      In the following example, suppose that the current default
  1031.      directory, `~rms/lewis', has five files whose names begin with `f':
  1032.      `foo', `file~', `file.c', `file.c.~1~', and `file.c.~2~'.
  1033.  
  1034.           (file-name-all-completions "f" "")
  1035.                => ("foo" "file~" "file.c.~2~"
  1036.                           "file.c.~1~" "file.c")
  1037.           
  1038.           (file-name-all-completions "fo" "")
  1039.                => ("foo")
  1040.  
  1041.  - Function: file-name-completion FILENAME DIRECTORY
  1042.      This function completes the file name FILENAME in directory
  1043.      DIRECTORY.  It returns the longest prefix common to all file names
  1044.      in directory DIRECTORY that start with FILENAME.
  1045.  
  1046.      If only one match exists and FILENAME matches it exactly, the
  1047.      function returns `t'.  The function returns `nil' if directory
  1048.      DIRECTORY contains no name starting with FILENAME.
  1049.  
  1050.      In the following example, suppose that the current default
  1051.      directory has five files whose names begin with `f': `foo',
  1052.      `file~', `file.c', `file.c.~1~', and `file.c.~2~'.
  1053.  
  1054.           (file-name-completion "fi" "")
  1055.                => "file"
  1056.           
  1057.           (file-name-completion "file.c.~1" "")
  1058.                => "file.c.~1~"
  1059.           
  1060.           (file-name-completion "file.c.~1~" "")
  1061.                => t
  1062.           
  1063.           (file-name-completion "file.c.~3" "")
  1064.                => nil
  1065.  
  1066.  - User Option: completion-ignored-extensions
  1067.      `file-name-completion' usually ignores file names that end in any
  1068.      string in this list.  It does not ignore them when all the possible
  1069.      completions end in one of these suffixes or when a buffer showing
  1070.      all possible completions is displayed.
  1071.  
  1072.      A typical value might look like this:
  1073.  
  1074.           completion-ignored-extensions
  1075.                => (".o" ".elc" "~" ".dvi")
  1076.  
  1077. 
  1078. File: lispref.info,  Node: Contents of Directories,  Next: Create/Delete Dirs,  Prev: File Names,  Up: Files
  1079.  
  1080. Contents of Directories
  1081. =======================
  1082.  
  1083.    A directory is a kind of file that contains other files entered under
  1084. various names.  Directories are a feature of the file system.
  1085.  
  1086.    XEmacs can list the names of the files in a directory as a Lisp list,
  1087. or display the names in a buffer using the `ls' shell command.  In the
  1088. latter case, it can optionally display information about each file,
  1089. depending on the value of switches passed to the `ls' command.
  1090.  
  1091.  - Function: directory-files DIRECTORY &optional FULL-NAME MATCH-REGEXP
  1092.           NOSORT FILES-ONLY
  1093.      This function returns a list of the names of the files in the
  1094.      directory DIRECTORY.  By default, the list is in alphabetical
  1095.      order.
  1096.  
  1097.      If FULL-NAME is non-`nil', the function returns the files'
  1098.      absolute file names.  Otherwise, it returns just the names
  1099.      relative to the specified directory.
  1100.  
  1101.      If MATCH-REGEXP is non-`nil', this function returns only those
  1102.      file names that contain that regular expression--the other file
  1103.      names are discarded from the list.
  1104.  
  1105.      If NOSORT is non-`nil', `directory-files' does not sort the list,
  1106.      so you get the file names in no particular order.  Use this if you
  1107.      want the utmost possible speed and don't care what order the files
  1108.      are processed in.  If the order of processing is visible to the
  1109.      user, then the user will probably be happier if you do sort the
  1110.      names.
  1111.  
  1112.      If FILES-ONLY is the symbol `t', then only the "files" in the
  1113.      directory will be returned; subdirectories will be excluded.  If
  1114.      FILES-ONLY is not `nil' and not `t', then only the subdirectories
  1115.      will be returned.  Otherwise, if FILES-ONLY is `nil' (the default)
  1116.      then both files and subdirectories will be returned.
  1117.  
  1118.           (directory-files "~lewis")
  1119.                => ("#foo#" "#foo.el#" "." ".."
  1120.                    "dired-mods.el" "files.texi"
  1121.                    "files.texi.~1~")
  1122.  
  1123.      An error is signaled if DIRECTORY is not the name of a directory
  1124.      that can be read.
  1125.  
  1126.  - Function: insert-directory FILE SWITCHES &optional WILDCARD
  1127.           FULL-DIRECTORY-P
  1128.      This function inserts (in the current buffer) a directory listing
  1129.      for directory FILE, formatted with `ls' according to SWITCHES.  It
  1130.      leaves point after the inserted text.
  1131.  
  1132.      The argument FILE may be either a directory name or a file
  1133.      specification including wildcard characters.  If WILDCARD is
  1134.      non-`nil', that means treat FILE as a file specification with
  1135.      wildcards.
  1136.  
  1137.      If FULL-DIRECTORY-P is non-`nil', that means FILE is a directory
  1138.      and switches do not contain `-d', so that the listing should show
  1139.      the full contents of the directory.  (The `-d' option to `ls' says
  1140.      to describe a directory itself rather than its contents.)
  1141.  
  1142.      This function works by running a directory listing program whose
  1143.      name is in the variable `insert-directory-program'.  If WILDCARD is
  1144.      non-`nil', it also runs the shell specified by `shell-file-name',
  1145.      to expand the wildcards.
  1146.  
  1147.  - Variable: insert-directory-program
  1148.      This variable's value is the program to run to generate a
  1149.      directory listing for the function `insert-directory'.
  1150.  
  1151. 
  1152. File: lispref.info,  Node: Create/Delete Dirs,  Next: Magic File Names,  Prev: Contents of Directories,  Up: Files
  1153.  
  1154. Creating and Deleting Directories
  1155. =================================
  1156.  
  1157.    Most Emacs Lisp file-manipulation functions get errors when used on
  1158. files that are directories.  For example, you cannot delete a directory
  1159. with `delete-file'.  These special functions exist to create and delete
  1160. directories.
  1161.  
  1162.  - Command: make-directory DIRNAME &optional PARENTS
  1163.      This function creates a directory named DIRNAME.  Interactively,
  1164.      the default choice of directory to create is the current default
  1165.      directory for file names.  That is useful when you have visited a
  1166.      file in a nonexistent directory.
  1167.  
  1168.      Non-interactively, optional argument PARENTS says whether to
  1169.      create parent directories if they don't exist. (Interactively, this
  1170.      always happens.)
  1171.  
  1172.  - Command: delete-directory DIRNAME
  1173.      This function deletes the directory named DIRNAME.  The function
  1174.      `delete-file' does not work for files that are directories; you
  1175.      must use `delete-directory' in that case.
  1176.  
  1177.